{% load staticfiles %}
{% comment %}
{% endcomment %}
<!-- top navigation -->
        <div class="top_nav">
          <div class="nav_menu">
            <nav>
              <div class="nav toggle">
                <a id="menu_toggle"><i class="fa fa-bars"></i></a>
              </div>

              <ul class="nav navbar-nav navbar-right">
                <li class="">
                  <a href="javascript:;" class="user-profile dropdown-toggle" data-toggle="dropdown" aria-expanded="false">
                    	{{ request.session.username }}
                  </a>
                  <ul class="dropdown-menu dropdown-usermenu pull-right">
                    <li><a href="javascript:;" onClick="logout()"><i class="fa fa-sign-out pull-right"></i> Log Out</a></li>
                  </ul>
                  </li>
                <li role="presentation" >
                  <a href="javascript:;" onClick="goback_horizon()" class="dropdown-toggle info-number" aria-expanded="false">
                    <i class="fa fa-th-large"></i>
                    <span>控制台</span>
                  </a>
                 </li>
              </ul>
            </nav>
          </div>
        </div>
        <!-- /top navigation -->
{% block js %} 
	<script type="text/javascript">
		function goback_horizon(){
			 $.ajax({
			    type:"GET",
			    url: "{% url 'horizon' %}",
			    async:false,
			    success:function(data){
			            window.location.href =data.horizon_url ;
			    } 
			 })
		}
		
		function logout(){
			 $.ajax({
				    type:"GET",
				    url: "{% url 'logout' %}",
				    async:false,
				    success:function(data){
				            window.location.href =data.horizon_url ;
				    } 
				 })
		}
	</script>
{% endblock %}